﻿using System;
using System.Collections.Generic;
using GraphProcessor;
using IQIGame.Onigao.Logic;
using UnityEngine;

namespace IQIGame.Onigao.GamePlay.Editors
{
    [System.Serializable, NodeMenuItem(LevelEditorConst.Execution + "/" + LevelEditorConst.EnableQuickBar, typeof(LevelServiceGraph))]
    public class LevelServiceExecutionNode_EnableQuickBar : LevelServiceExecutionNode
    {
        protected override ServiceExecutionType mServiceType => ServiceExecutionType.EnableQuickBar;
        public override string name => LevelEditorConst.EnableQuickBar;
        
        [InspectorName("是否激活切换")]
        public bool isEnabled;

        protected override LevelServiceCustomConfig CreateConfig()
        {
            var rConfig = new LevelServiceExecutionCustom_EnableQuickBar()
            {
                isEnabled = this.isEnabled
            };
            return rConfig;
        }

        protected override void OnSync(EditorLevelServiceExecutionConfig newConfig, LevelServiceExecutionNode tempNode)
        {
            if (tempNode is LevelServiceExecutionNode_EnableQuickBar rNode)
            {
                this.isEnabled = rNode.isEnabled;
            }
        }
    }
}